<div nz-row>
  <div nz-col nzOffset="4" [nzOrder]="formOrder" [nzXXl]="12" [nzXl]="12" [nzLg]="24" [nzMd]="24" [nzSm]="24"
       [nzXs]="24">
    <button (click)="add()" nz-button [nzType]="'dashed'" nzBlock class="m-b-8 m-t-20">
      <i nz-icon nzType="plus"></i>
      <span>添加</span>
    </button>
    <form [nzLayout]="'horizontal'" nz-form [formGroup]="validateForm" (ngSubmit)="submitForm()">
      <nz-form-item>
        <nz-form-label nzSpan="7" nzFor="law">法规信息</nz-form-label>
        <nz-form-control nzSpan="12" nzErrorTip="法规信息">
          <nz-textarea-count [nzMaxCharacterCount]="255">
            <textarea nz-input formControlName="law" placeholder="法规信息"
                      [nzAutosize]="{ minRows: 2, maxRows: 6 }"></textarea>
          </nz-textarea-count>
        </nz-form-control>
      </nz-form-item>
      <nz-divider></nz-divider>
      <ng-container formArrayName="lawDetailList">
        <ng-container [formGroupName]="groupIndex" *ngFor="let item of valuesArray.controls;let groupIndex=index">
          <nz-form-item>
            <nz-form-label nzSpan="7" nzFor="lawDetail">法律条目</nz-form-label>
            <nz-form-control nzSpan="12" [nzErrorTip]="combineTpl">
              <input nz-input formControlName="lawDetail" id="lawDetail" placeholder="法律条目"/>
            </nz-form-control>
          </nz-form-item>
          <nz-form-item>
            <nz-form-label nzSpan="7" nzFor="remark">备注</nz-form-label>
            <nz-form-control nzSpan="12" [nzErrorTip]="combineTpl">
              <input nz-input formControlName="remark" id="remark" placeholder="备注">
            </nz-form-control>
          </nz-form-item>
          <nz-form-item>
            <nz-form-control [nzOffset]="16">
              <button (click)="del(groupIndex)" nz-button [nzGhost]="true" [nzType]="'primary'">
                <i nz-icon nzType="minus"></i>移除
              </button>
            </nz-form-control>
          </nz-form-item>
          <nz-divider></nz-divider>
        </ng-container>
      </ng-container>
      <nz-form-item *ngIf="AdminService.isAdmin" nz-row class="register-area">
        <nz-form-control [nzSpan]="7" [nzOffset]="7">
          <button nz-button nzType="primary">确定</button>
        </nz-form-control>
      </nz-form-item>
    </form>
  </div>
</div>
<ng-template #combineTpl let-control>
  <ng-container *ngIf="control.hasError('message')">{{control.errors['message']}}</ng-container>
  <ng-container *ngIf="control.hasError('required')">必填项</ng-container>
</ng-template>


